import locks
import entities
import svc
import log
import util

class ClientEntityScene(entities.BaseEntityScene):
    __guid__ = 'entities.ClientEntityScene'

    def __init__(self, broker, sceneID):
        entities.BaseEntityScene.__init__(self, broker, sceneID)
        self.broker.LogInfo('Creating new ClientEntityScene', sceneID)



    def AddEntityToRegisteredList(self, entity):
        super(type(self), self).AddEntityToRegisteredList(entity)
        if (entity.entityID == session.charid):
            self.broker.LogInfo('Setting player character')
            self.broker.SetPlayerEntity(entity)



    def RemoveEntityFromRegisteredList(self, entity):
        super(type(self), self).RemoveEntityFromRegisteredList(entity)
        if (entity.entityID == session.charid):
            self.broker.LogInfo('Clearing player character')
            self.broker.SetPlayerEntity(None)




class EntityClient(svc.BaseEntityService):
    __guid__ = 'svc.entityClient'


